<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Storage;

class RunGameRole extends Model
{
    public $timestamps = false;
    protected $table = 'run_game_roles';


    /**
     * 添加角色
     * @param $request
     * @return array
     */
    static function AddRole($request)
    {
        $role = new RunGameRole();
        $role->path = Storage::url($request->pic->store('/', 'oss'));
        if (!$role->save()) {
            return ['status' => 2, 'message' => '失败'];
        }

        return ['status' => 1, 'message' => '成功'];
    }
}
